home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / image / scncd410.zip / SCANCODE.DOC < prev   
Text File  |  1996-09-23  |  77KB  |  2,042 lines

  1.  
  2.  
  3.  
  4.                                    SCANCODE 4.10
  5.  
  6.                                  TABLE OF CONTENTS
  7.  
  8.  
  9.      WHAT IS SCANCODE? . . . . . . . . . . . . . . . . . . . . . . . . .    2
  10.  
  11.      HOW TO USE SCANCODE . . . . . . . . . . . . . . . . . . . . . . . .    6
  12.           Quiet  . . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  13.           Table  . . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  14.           "String" . . . . . . . . . . . . . . . . . . . . . . . . . . .    8
  15.           CodeWord . . . . . . . . . . . . . . . . . . . . . . . . . . .    8
  16.           nn (decimal scan code) . . . . . . . . . . . . . . . . . . . .    9
  17.           Uninstall  . . . . . . . . . . . . . . . . . . . . . . . . . .   10
  18.           Delay  . . . . . . . . . . . . . . . . . . . . . . . . . . . .   11
  19.           WaitForText row,column "Text"  . . . . . . . . . . . . . . . .   12
  20.           WaitForKey <key> . . . . . . . . . . . . . . . . . . . . . . .   14
  21.           Loop n . . . . . . . . . . . . . . . . . . . . . . . . . . . .   16
  22.           Repeat . . . . . . . . . . . . . . . . . . . . . . . . . . . .   18
  23.  
  24.      THE SCANCODE ENVIRONMENT VARIABLE . . . . . . . . . . . . . . . . .   19
  25.  
  26.      CODE WORDS RECOGNIZED BY SCANCODE . . . . . . . . . . . . . . . . .   20
  27.  
  28.      DECIMAL KEYBOARD SCAN CODES . . . . . . . . . . . . . . . . . . . .   21
  29.  
  30.      HOLDING DOWN MORE THAN ONE KEY AT A TIME  . . . . . . . . . . . . .   22
  31.  
  32.      WHAT ARE SCAN CODES?  . . . . . . . . . . . . . . . . . . . . . . .   24
  33.  
  34.      HOW SCANCODE WORKS  . . . . . . . . . . . . . . . . . . . . . . . .   26
  35.  
  36.      SPECIAL NOTES . . . . . . . . . . . . . . . . . . . . . . . . . . .   27
  37.  
  38.      SCANCODE AND MICROSOFT WINDOWS  . . . . . . . . . . . . . . . . . .   31
  39.  
  40.      A WORD FROM THE SPONSOR . . . . . . . . . . . . . . . . . . . . . .   32
  41.  
  42.      OTHER PROGRAMS  . . . . . . . . . . . . . . . . . . . . . . . . . .   32
  43.  
  44.      WARRANTY  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  45.  
  46.      REVISION HISTORY  . . . . . . . . . . . . . . . . . . . . . . . . .   34
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                        SCANCODE 4.10            Page 1 of 34
  62.  
  63.  
  64.      WHAT IS SCANCODE?
  65.      ═════════════════
  66.  
  67.      SCANCODE is a program that lets you  "fake" keystrokes from the keyboard
  68.      when you are  in the middle of another  DOS program.  The  other program
  69.      will  think you are  typing something on  the keyboard when  you aren't.
  70.      You  can use SCANCODE to  automate the repetitive  keystrokes you always
  71.      have to type at the beginning, middle, or end of a program.
  72.  
  73.      SCANCODE  starts with the  same premise  as some  other programs  on the
  74.      market,  for example  PC Magazine's  KEY-FAKE.   But SCANCODE  goes much
  75.      further than these other  programs.  First of all,  SCANCODE has several
  76.      different ways you  can tell it when to "type"  something.  SCANCODE can
  77.      either wait for a specified amount of time, wait for a certain string of
  78.      text to  appear somewhere on the  screen, or wait  for you to give  it a
  79.      signal with the keyboard.
  80.  
  81.      Another difference between  SCANCODE and  these other  programs is  that
  82.      SCANCODE will "type"  ANY keystroke  combination you can  type from  the
  83.      keyboard (for example, <Alt>, <CapsLock>, <Shift>-<PrintScreen>, <Ctrl>-
  84.      <Alt>-<Del>, or just "regular text").  The other  programs are just able
  85.      to type  "regular text".  This  is because the other  programs use ASCII
  86.      codes  to stuff the  Keyboard Buffer, while  SCANCODE simulates keyboard
  87.      hardware  interrupts.   Explaining the difference  between the  two gets
  88.      pretty complicated, and is discussed below under "WHAT ARE SCAN CODES?".
  89.  
  90.      A final difference between SCANCODE and these other programs is that you
  91.      can  have more  than  one SCANCODE  in memory  at  the same  time.   The
  92.      different SCANCODES  operate independently of each  other (in parallel),
  93.      so that they can all be "waiting" for something different  to happen, or
  94.      can  all be  "typing" different  things at  the same  time.   While they
  95.      operate  independently of each  other, they can  also "communicate" with
  96.      each  other to let the other ones  know that something happened (see the
  97.      Uninstall and  WaitForKey Options  below).   This  allows an  incredible
  98.      amount of flexibility  in how you use SCANCODE, including the ability to
  99.      "type" different things depending on exactly what your program does.
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.                        SCANCODE 4.10            Page 2 of 34
  122.  
  123.  
  124.      Let's  assume, for example, that almost every time you start WordPerfect
  125.      5.1, you  hit <F5> <Enter>  to pull  up a directory  of existing  files.
  126.      When WordPerfect  first starts,  there is  always a  status line  at the
  127.      bottom of  the screen, with the  word "Doc" appearing at  row 25, column
  128.      53.   Using  SCANCODE,  you  can save  yourself  a  couple  of  annoying
  129.      keystrokes by writing a batch file (WP.BAT) as follows:
  130.  
  131.        ECHO OFF
  132.        C:
  133.        CD\WP
  134.        SCANCODE WaitForText 25,53 "Doc",            F5,        Enter
  135.          REM    Wait for "Doc" at row 25 column 53, Type <F5>, Type <Enter>
  136.        WP
  137.        CD\
  138.  
  139.      Every  time you start WordPerfect with  the above WP.BAT batch file, you
  140.      will automatically get a file list.
  141.  
  142.  
  143.      As another  example, let's use Lotus 1-2-3.  When you start 1-2-3, there
  144.      is  a Lotus logo that  appears on the screen for  about 5 seconds (which
  145.      you would just as soon not see).  In the older versions of Lotus, if you
  146.      strike  a key on the keyboard while the  logo is on the screen, the logo
  147.      will disappear right away (not hanging  around for the full 5  seconds).
  148.      Also,  almost  every time  you  start  the program,  you  do  a "/  File
  149.      Retrieve"  to pull up  a list of existing  files to pick  from.  You can
  150.      write a batch file (123.BAT) as follows to do the initial keystrokes for
  151.      you:
  152.  
  153.        ECHO OFF
  154.        C:
  155.        CD\LOTUS
  156.        SCANCODE Delay 1,       Enter, "1", Delay 1,        Enter, "/fr"
  157.          REM    Delay 1 second             Delay 1 second
  158.        LOTUS
  159.        CD\
  160.  
  161.      Every time  you start Lotus 1-2-3 with the above 123.BAT batch file, you
  162.      will automatically start 1-2-3 and get a file list.
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.                        SCANCODE 4.10            Page 3 of 34
  182.  
  183.  
  184.      As another  example,  we'll  use a  (no-name)  DOS program  that  I  use
  185.      sometimes.  To exit the  program, you type <Esc>.  Then  a "promotional"
  186.      screen appears, which you have  to see for at least 1 second.   Then you
  187.      have  to hit  <Esc> again  before you  REALLY exit  the program.   Well,
  188.      nowadays  I start the  program with a  batch file like  this, and I only
  189.      have  to hit <Esc> one time (and  the "promotional" screen flashes by so
  190.      fast I don't even notice it):
  191.  
  192.        ECHO OFF
  193.        C:
  194.        CD\no-name
  195.        SCANCODE WaitForKey Esc,     Esc,        Delay 1,        Esc
  196.          REM    Wait for <Esc> key, Type <Esc>, Delay 1 second, Type <Esc>
  197.        no-name
  198.        CD\
  199.  
  200.  
  201.      As yet another example, let's assume your using a DOS  program to backup
  202.      your hard drive  (we'll call it "BACKUP").  You're  using the same disks
  203.      you used last time you backed up your hard drive, so BACKUP keeps asking
  204.      you  if you want to  overwrite the existing files, and  you have to keep
  205.      constantly  hitting  "y" on  the  keyboard.   Needless  to say,  you get
  206.      annoyed -  and SCANCODE could be the  answer.  You could  set up a batch
  207.      file similar to following and have SCANCODE "type" the y's for you:
  208.  
  209.        ECHO OFF
  210.        C:
  211.        CD\BACKUP
  212.        SCANCODE WaitForText 12,12 "Overwrite [Y/N]?", "y",      Repeat
  213.          REM    Wait for the text,                    Type <y>, Repeat it
  214.        BACKUP
  215.        SCANCODE Uninstall
  216.          REM Whenever you use Repeat (or a Loop), be sure to put a
  217.          REM   "SCANCODE Uninstall" at the end of the Batch file like this
  218.        CD\
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.                        SCANCODE 4.10            Page 4 of 34
  242.  
  243.  
  244.      As a  final example, I  will use  a personal situation.   I had  a PC/XT
  245.      Turbo  clone, which I could toggle  between 4.77 MHz and  10 MHz.  There
  246.      were two ways to switch this speed - one  was with a button on the front
  247.      of the computer, and the other was  from the keyboard with <Ctrl>-<Alt>-
  248.      <Grey->.  Most of the time I left  it at 10 MHz, but there were  certain
  249.      programs  I had  (mainly old  Games)  that required  the computer  to be
  250.      operating at 4.77 MHz.
  251.  
  252.      Before I wrote SCANCODE, every time I used these programs,  I would have
  253.      to remember that  the particular program needed to run  at 4.77 MHz, and
  254.      then push  the button on the front of the  computer.  When I was through
  255.      with the program, I had  to remember to push the button  again to switch
  256.      the computer back  to 10  MHz.  This  was a  real pain.   After I  wrote
  257.      SCANCODE,  I had batch files  similar to the  following to automatically
  258.      start these programs:
  259.  
  260.        ECHO OFF
  261.        CD\program
  262.        SCANCODE Ctrl-Alt-Grey-
  263.          REM    Toggle to 4.77 MHz
  264.        program
  265.        SCANCODE Ctrl-Alt-Grey-
  266.          REM    Toggle back to 10 MHz
  267.        CD\
  268.  
  269.      Just so you know, most computers these days still have a "slow" mode and
  270.      a "fast"  mode.  Most  newer computers I've  seen use  Ctrl-Alt-Grey- to
  271.      toggle to the "slow"  mode, and Ctrl-Alt-Grey+  to toggle to the  "fast"
  272.      mode.
  273.  
  274.  
  275.      I will leave  it to  your imagination as  to how many  ways you can  use
  276.      SCANCODE.
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.                        SCANCODE 4.10            Page 5 of 34
  302.  
  303.  
  304.      HOW TO USE SCANCODE
  305.      ═══════════════════
  306.  
  307.      NOTE:  As  of version  3.00, the  command line  Options for  SCANCODE no
  308.      longer work like they did in versions 1.x and 2.x.  If you have existing
  309.      batch files  that have SCANCODE commands  in them, you may  need to edit
  310.      the batch files to work correctly with newer versions of SCANCODE.
  311.  
  312.      The syntax for using SCANCODE is as follows:
  313.  
  314.        SCANCODE [Q | Quiet] [T | Tbl | Table] scancode1 [scancode2] ...,
  315.  
  316.      where  the "scancodes" are either keyboard Scan Codes that SCANCODE will
  317.      use to "fake"  keyboard hardware  interrupts, or special  codes to  tell
  318.      SCANCODE  to  wait  for something  to  happen  before  continuing.   The
  319.      individual Scan  Codes can  be separated  by spaces or  by commas.   For
  320.      example, "SCANCODE W1 1'File''A'" works the same as
  321.      "SCANCODE WaitForText 1,1 'File', 'A'".  The second one is, I hope, much
  322.      easier to read and  understand.  If you  don't enter any Scan Codes,  or
  323.      try to enter something that SCANCODE doesn't understand, you will get an
  324.      error message.
  325.  
  326.      In  general,  the Options  can either  be in  upper  case or  lower case
  327.      ("Quiet" is  the same Option as  "QUIET" or "QuiEt").   The exception to
  328.      this, usually,  is something enclosed in  quotes ("Text").  If  you read
  329.      the details in the command line Options below, it should be fairly clear
  330.      when something  you type is  case sensitive or not  (SCANCODE only makes
  331.      things case sensitive when it needs to).
  332.  
  333.      Note also that  there are  usually several different  ways to enter  the
  334.      same Option.  For example, to be Quiet, you can either type "SCANCODE Q"
  335.      or "SCANCODE  Quiet".  The Options have a "shorthand" code ("Q") and one
  336.      or more "longhand" codes ("Quiet").  The "shorthand" codes take  up much
  337.      less room and are easier to  type, but the "longhand" codes are probably
  338.      easier to remember  and to read.   You can use whichever  makes the most
  339.      sense to you.
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.                        SCANCODE 4.10            Page 6 of 34
  362.  
  363.  
  364.           Q
  365.           Quiet
  366.  
  367.             The "Q" (or "Quiet") is optional, and  if there tells SCANCODE to
  368.             be QUIET  (to not send  its opening message  about who  wrote the
  369.             program  to the screen).  SCANCODE always sends error messages to
  370.             the screen;  the "Q" just  tells SCANCODE to be QUIET as  long as
  371.             everything is OK.
  372.  
  373.  
  374.           T
  375.           Tbl
  376.           Table
  377.  
  378.             The "T" (or  "Tbl" or  "Table") is  also optional,  and if  there
  379.             tells SCANCODE that you want a TABLE of decimal  Scan Codes shown
  380.             on  the  screen.   This  lets  you  use SCANCODE  as  an  on-line
  381.             reference for  Scan Codes.  If  you tell SCANCODE you  want it to
  382.             show  you a TABLE, it pretty much  ignores anything else you tell
  383.             it to do and just shows you the TABLE.  For example, if you typed
  384.             "SCANCODE Table Enter", SCANCODE would show you the TABLE of Scan
  385.             Codes, but would never  install itself into memory to  "type" the
  386.             <Enter> key.
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.                        SCANCODE 4.10            Page 7 of 34
  422.  
  423.  
  424.        There are three different ways to tell SCANCODE what to "type":
  425.  
  426.           'String'
  427.           "String"
  428.  
  429.             A string enclosed in single or double quotes.  Inside the  quotes
  430.             can be  any series of valid ASCII characters (all the letters and
  431.             numbers, spaces, and `~!@#$%^&*()-_=+\|[]{};:'",.<>/?).  SCANCODE
  432.             has an internal table it uses to translate these ASCII characters
  433.             into their equivalent  Scan Codes  (for example, if  you enter  a
  434.             "$", SCANCODE "types" a <Shift>-<4>).
  435.  
  436.             Note  also when  entering  characters that  SCANCODE ignores  the
  437.             state  of  any  other  keys  (of  particular importance  are  the
  438.             CapsLock and NumLock keys).  For example, if you tell SCANCODE to
  439.             do an  "ST", SCANCODE does  a <Shift>-<s>, <Shift>-<t>,  which is
  440.             normally an "ST".  However, if you have CapsLock turned on  while
  441.             SCANCODE is doing its thing, <Shift>-<s>, <Shift>-<t> will become
  442.             "st", not "ST".
  443.  
  444.  
  445.           CodeWord
  446.  
  447.             A Code Word for one of the keys on the keyboard (for example, F1,
  448.             Enter, CapsLock,  Shift, Tab, etc.).   See the Table below  for a
  449.             list of Code Words that SCANCODE recognizes.
  450.  
  451.             There are two "special" Code Words that SCANCODE handles a little
  452.             differently than the rest  of the Code Words -  "PrintScreen" and
  453.             "Break" (or the allowable  variations of these Code Words).   The
  454.             reason these  Code Words  require special  handling is  that what
  455.             they should do depends on the situation.
  456.  
  457.             To  print the screen with the keyboard from older computers (PC's
  458.             and PC/XT's), you  have to  do a <Shift>-<Grey*>.   The  keyboard
  459.             that comes with newer computers (PC/AT's and newer) has a special
  460.             <PrintScreen> key that you don't need to <Shift>.  SCANCODE knows
  461.             what   kind  of  keyboard  you  have,  and  when  you  enter  the
  462.             "PrintScreen"  Code Word, SCANCODE assumes  you want to print the
  463.             screen.  If  you have an old computer, and  you give SCANCODE the
  464.             "PrintScreen"  Code Word, it does a <Shift>-<Grey*>.  If you have
  465.             a newer computer, SCANCODE does a <PrintScreen>.
  466.  
  467.             Regardless of whether  your computer is  old or new, in  order to
  468.             "Break"  a  program, you  have to  Enter  a <Ctrl>-<Break>;   the
  469.             <Break>  key all  by itself  does not  "Break" anything.   If you
  470.             enter the "Break" Code Word (or allowable variations of "Break"),
  471.             SCANCODE  automatically does a <Ctrl>-<Break>.   If you study the
  472.             Decimal Scan Code  Table below, you will  see that <Ctrl>-<Break>
  473.             on older computers (PC's and PC/XT's) is handled differently than
  474.             it is on  newer computers.   Again, SCANCODE  knows whether  your
  475.             computer   is  old  or  new,  and  handles  all  of  the  details
  476.             automatically - you just  have to give SCANCODE the  "Break" Code
  477.             Word.
  478.  
  479.  
  480.  
  481.                        SCANCODE 4.10            Page 8 of 34
  482.  
  483.  
  484.           nn (decimal scan code)
  485.  
  486.             A  decimal Scan Code (see the Tables  below for a list of decimal
  487.             Scan Codes you can use).  This  is how you tell SCANCODE to enter
  488.             "unusual" keystrokes  or  keystroke combinations  that you  can't
  489.             enter  with a String or a Code  Word.  The Strings and Code Words
  490.             will handle nearly all  common situations, so you shouldn't  need
  491.             to enter decimal Scan Codes very often.  For example,
  492.             "SCANCODE 29-01" would be the same as "SCANCODE Ctrl-Esc".
  493.  
  494.             A decimal  Scan Code  of  0 (or  the Code  Word "Release")  tells
  495.             SCANCODE to do the "release" Scan Codes for any "push" Scan Codes
  496.             it hasn't  released yet.   This is  a holdover from  the previous
  497.             versions of SCANCODE,  and will  probably not be  too useful  any
  498.             more (see the sections  below on "HOLDING DOWN MORE THAN  ONE KEY
  499.             AT A TIME" and "WHAT ARE SCAN CODES?").
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.                        SCANCODE 4.10            Page 9 of 34
  542.  
  543.  
  544.        You can remove any old SCANCODEs you have in memory, in case you don't
  545.        need them or want them any more:
  546.  
  547.           U
  548.           Uninstall
  549.  
  550.             Either  of  these  will disable  and  UNINSTALL  from  memory any
  551.             previous  SCANCODEs that are still in memory.   SCANCODE is a TSR
  552.             (Terminate and Stay Resident)  program that remains in  memory as
  553.             long as it  takes to "do its thing", and  then tries to UNINSTALL
  554.             itself from memory.   Sometimes a SCANCODE will remain  in memory
  555.             for a  very  long  time (perhaps  forever  - see  the  "Loop  n",
  556.             "Repeat",  and "WAIT  row col  'Text'" Options  below) before  it
  557.             considers  itself done.   If you put  a SCANCODE in  memory to do
  558.             something,  and then  change your  mind, decide  you have  made a
  559.             mistake, or for some other reason  want to "turn it off", this is
  560.             how you do  it.  "SCANCODE U" or  "SCANCODE Uninstall" will "turn
  561.             off"  and  UNINSTALL any  previous  SCANCODEs that  are  still in
  562.             memory.
  563.  
  564.             SCANCODE  does not  UNINSTALL  the previous  SCANCODES in  memory
  565.             until it gets  to the  "Uninstall" portion of  the command  line.
  566.             For example, if you type:
  567.  
  568.                SCANCODE Enter, Delay 10, Uninstall, Enter
  569.  
  570.             SCANCODE "types"  an <Enter>,  waits 10 seconds,  then UNINSTALLs
  571.             any  previous SCANCODES  that  were in  memory, and  then "types"
  572.             another <Enter>.  This  is one way different SCANCODEs  in memory
  573.             can communicate with each other.  See the "SPECIAL NOTES" section
  574.             below for examples  on how you can use this  Option to build some
  575.             sophisticated batch files.
  576.  
  577.             If you use SCANCODEs  in your batch files a lot, you  may want to
  578.             put  a  "U" or  "Uninstall"  as  the first  Option  in the  first
  579.             SCANCODE  line  of  each   batch  file  ("SCANCODE  U   {rest  of
  580.             Options}").  This  way you  will be  sure any  SCANCODEs left  in
  581.             memory  from previous batch files are disabled and won't screw up
  582.             your  current  program.   You  may  also  want to  put  a  simple
  583.             "SCANCODE Uninstall"  at the end of all your batch files that use
  584.             SCANCODE, to  make  sure SCANCODEs  from  this batch  file  won't
  585.             affect future programs.
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                       SCANCODE 4.10            Page 10 of 34
  602.  
  603.  
  604.        You can also have SCANCODE wait  for certain things to occur before it
  605.        types something:
  606.  
  607.           D nn
  608.           Dly nn
  609.           Delay nn
  610.  
  611.             Any  of  these   three  Options  tells  SCANCODE   to  DELAY  for
  612.             approximately nn seconds before continuing on.  Nn can be between
  613.             1  (1 second) and  3600 (approximately  1 hour).   This  DELAY is
  614.             useful  for programs that have a built-in delay at the beginning,
  615.             during which you can't  do anything.  For example,  some programs
  616.             show  a fancy  logo on  the  screen for  several  seconds at  the
  617.             beginning of  the program.  During  this logo time, you  can't do
  618.             anything, and the program ignores any keystrokes you try to enter
  619.             while the  logo is on the screen.  For example, if the logo stays
  620.             on  for five seconds,  and after the  logo you want  to "type" an
  621.             <a>, you can put
  622.             "SCANCODE Delay 5, 'a'" as a line in your batch file to start the
  623.             program.
  624.  
  625.             If you have a  DELAY in the middle of a  SCANCODE line, and there
  626.             are still any "push" Scan Codes still waiting to be released (you
  627.             need to read  the section below, "WHAT  ARE SCAN CODES?",  if you
  628.             don't understand "push" and  "release" Scan Codes), a "Delay  nn"
  629.             will also act  like the  key(s) are continually  being pushed  (a
  630.             repeating  key).   This  will simulate  a  key (or  keys) on  the
  631.             keyboard  being held down for "nn" seconds, with the keyboard set
  632.             at a  repeat  rate of  approximately  18 characters  per  second.
  633.             After  being held  down  for these  "nn"  seconds, the  keys  are
  634.             released.    For  example,   "SCANCODE  30-Delay  1"  will  enter
  635.             "aaaaaaaaaaaaaaaaaa"  (18  <a>'s),  and  then  release  the  <a>.
  636.             Entering 18 a's at  the beginning of a program  probably wouldn't
  637.             be  very useful, but sometimes  holding down a  Shift key or Ctrl
  638.             key while a program is starting is useful.
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                       SCANCODE 4.10            Page 11 of 34
  662.  
  663.  
  664.           W row,column "Text"
  665.           Wait row,column "Text"
  666.           WaitFor row,column "Text"
  667.           WaitForText row,column "Text"
  668.           WaitText row,column "Text"
  669.           Text row,column "Text"
  670.           TextWait row,column "Text"
  671.  
  672.             Any  of these Options tells SCANCODE to WAIT until "Text" appears
  673.             on the screen  at Row, Column before continuing on.   The row and
  674.             column numbers can be any number between 0 and 65535.  "Text" can
  675.             be any character or string of characters, and must be enclosed in
  676.             single or double quotes.
  677.  
  678.             Row 1 is at the top of the screen, and column 1 is at the left of
  679.             the screen.   If  you enter  a 0  for  either the  row or  column
  680.             number, you are telling SCANCODE to search in ALL rows or columns
  681.             for  "Text".   For  example, "SCANCODE  WaitFor 1,0  'File'" will
  682.             search for the word "File" in row 1, any column.  If it finds the
  683.             word "File"  ANYWHERE in row  1 on  the screen, it  continues on.
  684.             "SCANCODE  WaitFor 0,5 'Text'" will  look for the  word "Text" on
  685.             all  rows,  but  the  "T"  in  "Text"  must  start  in column  5.
  686.             "SCANCODE  WaitFor 0,0 'C'" will search the ENTIRE SCREEN for the
  687.             letter "C".   If it finds a  "C" anywhere on the screen,  it will
  688.             continue on.
  689.  
  690.             Keep in mind that takes SCANCODE a LOT longer to search an entire
  691.             row,  entire column, or especially an entire screen, than it does
  692.             to search just one specific  location on the screen for  a match.
  693.             Your  computer can't  be doing  anything else  while  SCANCODE is
  694.             searching for the  "Text".  If you have a  fast computer, you may
  695.             not even notice it.  If you have a slow computer, though, you may
  696.             not want to put 0's  in the row and  column numbers if you  don't
  697.             have  to.  I realize that counting rows and columns can be a huge
  698.             pain, but is worth it if you want to keep things hopping along.
  699.  
  700.             The "Text" SCANCODE is Waiting For must all be in the same row on
  701.             the  screen.  For instance, if  you type "SCANCODE W 0,0 'Text'",
  702.             and there is "T" at  the end of row 1, and "ext" at the beginning
  703.             of row 2, it is NOT a match.
  704.  
  705.             Whatever  you have inside the quotes is case-sensitive.  That is,
  706.             if you type "SCANCODE WaitFor  1,1 'Text'", and on the screen  at
  707.             row 1, column 1 is "TEXT", it is NOT a match.
  708.  
  709.             Having SCANCODE WAIT like this is useful for programs that have a
  710.             variable-length delay at the beginning, during which you can't do
  711.             anything.   For  example, some  programs show  their logo  on the
  712.             screen for any number of seconds at the beginning of the program.
  713.             During  this logo  time,  the  program  is  loading  a  file  (or
  714.             something), and the  program ignores anything  you type from  the
  715.             keyboard.  When the logo finally disappears, the normal "program"
  716.             screen appears with a menu line  somewhere on the screen, and you
  717.             can start to use the keyboard again.
  718.  
  719.  
  720.  
  721.                       SCANCODE 4.10            Page 12 of 34
  722.  
  723.  
  724.             For example, say you have a program that can take anywhere from 1
  725.             second to  5 minutes to start,  depending on how big  the file is
  726.             that you  told it to load.   When the program  finally starts, it
  727.             has a  menu line at the top of the  screen, and the first item in
  728.             the menu (at row 1, column  1 on the screen) is "File".   As soon
  729.             as the program starts, you want to type "Start of  Text". You can
  730.             do  this  all automatically  with SCANCODE  and  a batch  file as
  731.             follows:
  732.  
  733.               ECHO OFF
  734.               CD \PROGRAM
  735.               SCANCODE WaitForText 1,1 "File", "Start of Text"
  736.               PROGRAM File_To_Load
  737.               CD \
  738.  
  739.             SCANCODE will WaitForText  patiently (perhaps forever)  until the
  740.             word "File"  appears on the  screen at row 1,  column 1.   If the
  741.             word "File" never appears,  SCANCODE never goes any further   (if
  742.             something like this happens, you can UNINSTALL SCANCODE  with the
  743.             "U" Option discussed above).
  744.  
  745.             Before  SCANCODE can  test the screen  to see  if it  matches the
  746.             "Text",  there are  a couple  of things  that must  happen first.
  747.             First  of  all, the  screen  must  be in  a  "text"  mode, not  a
  748.             "graphics" mode;  and secondly, the  row and column  numbers must
  749.             exist.
  750.  
  751.             When the  screen is in a  graphics mode, all SCANCODE  can see is
  752.             individual dots (pixels) on the screen.  There is no way SCANCODE
  753.             can reliably tell what a "row of text" is when all  it can see is
  754.             a bunch  of dots  (for example,  a simple  CGA screen  is 200x320
  755.             pixels, for  a total of 64,000  pixels - each of  which is stored
  756.             individually).  In a  "text" mode, however, the screen  is stored
  757.             as a  bunch of  characters (a  standard screen of  25 rows  by 80
  758.             columns is stored  as 2000 characters).  This doesn't mean that a
  759.             program  can't use graphics at all, but  as long as the screen is
  760.             in a  graphics mode, SCANCODE  can't do any  WaitForText testing,
  761.             and will just keep Waiting.
  762.  
  763.             There are many different sizes of screens in "text" mode.  So far
  764.             in my life, I have seen anywhere from 12 to 63 rows, and anywhere
  765.             from 40 to 132 columns.  SCANCODE can handle any  size.  However,
  766.             the  row and column numbers  you give SCANCODE  must exist before
  767.             SCANCODE  can  test  the "Text".    If  you  enter, for  example,
  768.             "SCANCODE W 12 150 'Text'", and the screen never has  at least 12
  769.             rows and  153 columns,  SCANCODE will  never be  able  to find  a
  770.             match.
  771.  
  772.             SCANCODE lets  you enter any  number between 0 and  65535 for the
  773.             row  and  column numbers,  but  has  no  way of  telling  what  a
  774.             "reasonable"  maximum number  is - that  depends on  exactly what
  775.             kind of computer you have.  It is up to you to not enter  any row
  776.             or  column  number that  will never  exist.   SCANCODE  will keep
  777.             Waiting  (forever, if necessary) until the screen has at least as
  778.             many rows and columns as are necessary to test the "Text".
  779.  
  780.  
  781.                       SCANCODE 4.10            Page 13 of 34
  782.  
  783.  
  784.           K <key>
  785.           Key <key>
  786.           KeyWait <key>
  787.           WaitKey <key>
  788.           WaitForKey <key>
  789.  
  790.             Any  of these  Options tells  SCANCODE to  wait  for <key>  to be
  791.             pressed on  the keyboard.   <key> can  be any SINGLE  key on  the
  792.             keyboard except <PrintScreen>.   It  can be entered  either as  a
  793.             single character in quotes  (SCANCODE WaitForKey "c"), a CodeWord
  794.             (SCANCODE K  RCtrl), or as a decimal  scan code (SCANCODE Key 1).
  795.             Multiple-keystrokes  (such  as  "SCANCODE  Key  Ctrl-C") are  not
  796.             allowed.
  797.  
  798.             When entering a single character in quotes, such as
  799.             "SCANCODE Key 'C'", SCANCODE treats upper-case and lower-case the
  800.             same:  "C"  and "c"  are  the  same  <key>.   Likewise  with  the
  801.             characters above  the number keys at the top of the keyboard: "$"
  802.             and "4" are the same <key>.
  803.  
  804.             This Option is useful when, for any number  of reasons, the Delay
  805.             or WaitForText Options don't  work, or you want to  tell SCANCODE
  806.             yourself  (with the keyboard) when it is OK to continue with what
  807.             it  is  doing.    You  can also  use  this  Option  as  a  way to
  808.             "communicate" between different SCANCODE's in memory.
  809.  
  810.             Once SCANCODE has "intercepted"  a particular keystroke, it waits
  811.             for you  to release the key  before it continues with  what it is
  812.             supposed to do.  For example, let's say you typed
  813.             "SCANCODE  Key Ctrl  'Go'".  If  you were  then trying  to type a
  814.             <Ctrl>-<C> in  your program, it would  not work.  When  you press
  815.             the <Ctrl>  key,  SCANCODE would  "intercept" it,  and the  other
  816.             program would never see it.  You then press the <C> key, which is
  817.             seen by your program  (without the <Ctrl>).  Your  program sees a
  818.             <C>  rather than  a <Ctrl>-<C>.    You can  keep  the <Ctrl>  key
  819.             pressed all day long while you do all kinds of keyboard pounding,
  820.             and SCANCODE will  be the only program  that knows the <Ctrl>  is
  821.             pressed.   When  you finally  release  the <Ctrl>  key,  SCANCODE
  822.             continues on its way and "types" <Shift>-<g> <o>.  The <Ctrl> key
  823.             then turns into a regular  key again and <Ctrl>-<C> works  in the
  824.             program like it used to.
  825.  
  826.             The point of this is to let you know that if you want to  use the
  827.             WaitForKey  Option, you  need to  be careful  about picking  your
  828.             <key>.  It needs to be a <key> that you won't type by accident at
  829.             some  inauspicious  time in  your  program  where SCANCODE  could
  830.             really screw something up.  Once you type the <key>, you probably
  831.             won't be able to stop SCANCODE from doing whatever you told it to
  832.             do after the <key> is pressed.
  833.  
  834.             With  SCANCODE, the effect of a single keystroke can be amplified
  835.             many times.  Just  keep in mind that it  can amplify the good  as
  836.             well as the bad.
  837.  
  838.  
  839.  
  840.  
  841.                       SCANCODE 4.10            Page 14 of 34
  842.  
  843.  
  844.             Since  SCANCODE can  use any  single key  on the  keyboard except
  845.             <PrintScreen>, you  shouldn't have too much  difficulty picking a
  846.             key that  you won't hit  by accident.   Some good  candidates are
  847.             <Esc>, <~>, <F11>, <F12>,  <Pause>, <ScrollLock>, <NumLock>,  and
  848.             some of  the "math" keys  around the numeric keypad  on the right
  849.             side of the keyboard.
  850.  
  851.             Once the <key>  is pressed and released,  SCANCODE just continues
  852.             on its way with its next command.  The <key> is  not passed on to
  853.             the other program you are running.  This means, for example, that
  854.             you can use SCANCODE to effectively "remap" your keyboard.  Let's
  855.             say you did  a "SCANCODE Key  'C' 'You typed a  C!'".  The  first
  856.             time you hit  the <c> key, you would never see  a "c".  You would
  857.             instead see "You  typed a C!".  The next time you hit the <c>, it
  858.             would be a regular "c".  Using the LOOP or  REPEAT Options below,
  859.             you could  do a more  permanent "remap" of  your keyboard.   Read
  860.             about these Options below for more details.
  861.  
  862.             The  WAITFORKEY Option  is  also a  way to  "communicate" between
  863.             different  SCANCODEs in memory.   That is, anything  typed by one
  864.             SCANCODE can  be "intercepted"  as a  <key> by another  SCANCODE,
  865.             just as if  you typed it on the keyboard  yourself.  For example,
  866.             let's say you typed the following two lines:
  867.  
  868.               SCANCODE Delay 10, "k", WaitForKey F1, "15"
  869.               SCANCODE WaitForKey "k", Delay 5, F1
  870.  
  871.             The first SCANCODE  waits ten  seconds, "types" a  <k>, and  then
  872.             starts waiting for an  <F1>.  The second SCANCODE  intercepts the
  873.             <k>  generated by  the first  SCANCODE, waits  five  seconds, and
  874.             "types" an <F1>.   The  first SCANCODE intercepts  the <F1>,  and
  875.             "converts"  it  to a  "15".   The only  thing  that would  end up
  876.             getting "typed" to  the screen is  the "15", and it  would happen
  877.             about 15 seconds after  you started.  There are  more complicated
  878.             and  intricate  examples  of  this kind  of  interaction  between
  879.             different SCANCODEs in the section below, "SPECIAL NOTES".
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.                       SCANCODE 4.10            Page 15 of 34
  902.  
  903.  
  904.        Normally,  after a SCANCODE gets through with what it's supposed to do
  905.        one time, it tries to remove itself  from memory.  There are two  ways
  906.        you can have SCANCODE keep repeating itself over again instead of just
  907.        stopping at the end of the line:
  908.  
  909.           L n
  910.           Loop n
  911.  
  912.             Either of  these Options tells  the SCANCODE  to LOOP and  do the
  913.             SCANCODE  line a total of n times, rather  than just one time.  N
  914.             can  be any  number between  1 and  65535.   For example,  if you
  915.             typed:
  916.  
  917.                SCANCODE Delay 1, "Now", Delay 4, Loop 3
  918.  
  919.             SCANCODE would delay 1 second, type "Now", delay 5 (4+1) seconds,
  920.             type  "Now", delay 5 seconds,  type "Now" again,  wait 4 seconds,
  921.             and  then  uninstall   itself  from  memory.     You  would   see
  922.             "NowNowNow".
  923.  
  924.             The "Loop  n" can be anywhere  on the SCANCODE line,  not just at
  925.             the end.   Also, if you  enter "Loop n" more  than once, SCANCODE
  926.             just uses the last  one you entered.  For  example, the following
  927.             three lines are equivalent:
  928.  
  929.                SCANCODE Loop 5, "Type This!", Loop 3
  930.                SCANCODE Loop 3, "Type This!"
  931.                SCANCODE "Type This!", Loop 3
  932.  
  933.             If you are using a LOOP (or a REPEAT) along  with the WAITFORTEXT
  934.             Option,  it is usually  a good idea  to put a  small DELAY at the
  935.             beginning or end of the line, as follows:
  936.  
  937.                SCANCODE Delay 1, WaitForText 10,10 "Hit <Esc>", Esc, Loop 25
  938.  
  939.             or:
  940.  
  941.                SCANCODE WaitForText 10,10 "Hit <Esc>", Esc, Delay 1, Loop 25
  942.  
  943.             rather than this:
  944.  
  945.                SCANCODE WaitForText 10,10 "Hit <Esc>", Enter, Loop 25
  946.  
  947.             This  is because some programs are relatively slow in reacting to
  948.             keystrokes  (like  this <Esc>  key) and  won't update  the screen
  949.             right away (by  removing the "Hit <Esc>" from the screen).  After
  950.             SCANCODE types the <Esc> key in the third line above (without the
  951.             DELAY), it will, within about 1/10 of a second, start looking for
  952.             "Hit <Esc>" on the screen again.   If the program hasn't had time
  953.             to get  rid of the "<Hit Esc>" from the screen yet after SCANCODE
  954.             typed  the first  <Esc>  key,  SCANCODE  will type  <Esc>  again.
  955.             Basically,  SCANCODE will type the  <Esc> key twice  for just one
  956.             "Hit <Esc>" on  the screen.  This would probably  cause all sorts
  957.             of  headaches for you.   Putting in the  Delay allows the program
  958.             time  to update  the  screen properly  so  that SCANCODE  doesn't
  959.             "overreact".
  960.  
  961.                       SCANCODE 4.10            Page 16 of 34
  962.  
  963.  
  964.             If you are in the middle of LOOPing and, for some reason, need to
  965.             get out of the LOOP early, you  will need to type a "SCANCODE  U"
  966.             or "SCANCODE Uninstall".  See the UNINSTALL Option above for more
  967.             details.
  968.  
  969.             If you tell SCANCODE  to LOOP one  time ("SCANCODE Loop 1")  it's
  970.             just like you never entered "Loop" at all.  Likewise, a
  971.             "Loop 65535" is,  for most practical applications  I can imagine,
  972.             the same  thing as an  infinite LOOP.   The REPEAT  Option below,
  973.             however, is a truly infinite LOOP.
  974.  
  975.             If you have a  LOOP and a REPEAT  on the same SCANCODE  line (for
  976.             example, "SCANCODE 'Text', Loop 2, Repeat"), SCANCODE will ignore
  977.             the LOOP and just do the REPEAT.
  978.  
  979.  
  980.             I expect the most  useful kind of program for a  LOOP or a REPEAT
  981.             would  be  some sort  of  Backup Program  or  Anti-Virus program.
  982.             These programs many times  will keep prompting you on  the screen
  983.             every  time they come across a "special" file (one that's already
  984.             been backed up  or one that it thinks may have a virus).  As long
  985.             as the  program is a  DOS program that runs  in text mode  on the
  986.             screen, you can use  SCANCODE with the LOOP or  REPEAT Options to
  987.             automatically respond to  the screen prompts  for you.   SCANCODE
  988.             will keep "typing" in  the appropriate key(s) for you,  no matter
  989.             how many times the screen prompt appears.
  990.  
  991.  
  992.             You could also use SCANCODE along with the LOOP or REPEAT Options
  993.             to  "remap"  your  keyboard  "permanently"  during  a  particular
  994.             program.  For example, say you  use a program (call it "program")
  995.             where the Help key is <F3>, but you want it to be <F1> so you can
  996.             remember  it easier.  As long as  the <F1> key isn't already used
  997.             for  something in  the program,  you could  set up  the following
  998.             batch file so that every time you hit <F1> the program will think
  999.             you hit the <F3> key instead:
  1000.  
  1001.                ECHO OFF
  1002.                CD\program
  1003.                SCANCODE WaitForKey F1, F3, Loop 65000
  1004.                program
  1005.                SCANCODE Uninstall
  1006.                CD\
  1007.  
  1008.             Using  multiple  WAITFORKEYs in  the same  batch file  along with
  1009.             LOOPs  or REPEATs requires some special  considerations.  See the
  1010.             "SPECIAL NOTES" section below for a discussion of this.
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.                       SCANCODE 4.10            Page 17 of 34
  1022.  
  1023.  
  1024.           R
  1025.           Repeat
  1026.  
  1027.             Either  of these  Options tells  SCANCODE to  keep REPEATing  the
  1028.             SCANCODE line indefinitely.  There are only two ways you can stop
  1029.             the SCANCODE line from REPEATing itself over and over again.  You
  1030.             can either turn off the computer,  or you can type a "SCANCODE U"
  1031.             (or "SCANCODE Uninstall").
  1032.  
  1033.             The  REPEAT option  works exactly  the same  as the  LOOP Option,
  1034.             except that with the  REPEAT Option SCANCODE will NEVER  stop all
  1035.             by itself (you MUST type a "SCANCODE U" or "SCANCODE Uninstall").
  1036.             Read the section directly  above on the LOOP Option  for details,
  1037.             examples,  and cautions - just replace "Loop n" with "Repeat" and
  1038.             everything applies just  the same.  There  is also an example  of
  1039.             using the REPEAT Option above in the section "WHAT IS SCANCODE?".
  1040.  
  1041.  
  1042.        I hope you see  that with a little  ingenuity, SCANCODE can be a  very
  1043.        powerful tool.
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.                       SCANCODE 4.10            Page 18 of 34
  1082.  
  1083.  
  1084.      THE SCANCODE ENVIRONMENT VARIABLE
  1085.      ═════════════════════════════════
  1086.  
  1087.      In addition to these command line Options,  SCANCODE also looks for an
  1088.      environment  variable named  SCANCODE.   If this  environment variable
  1089.      exists, it  must be  equal to "Q"  or "QUIET",  and permanently  tells
  1090.      SCANCODE  to be  QUIET (the  same thing  as  the "QUIET"  command line
  1091.      Option listed above).  To tell SCANCODE to always be QUIET, type
  1092.      "SET SCANCODE=Q" or  "SET SCANCODE=QUIET"  from the  DOS command  line
  1093.      before you use SCANCODE for the first time (in your AUTOEXEC.BAT file,
  1094.      for instance).  See your  DOS book or some other book you trust if you
  1095.      need more information on what an "environment" is and what  it is used
  1096.      for.
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.                       SCANCODE 4.10            Page 19 of 34
  1142.  
  1143.  
  1144.      ╔═══════════════════════════════════════════════════════════════════════╗
  1145.      ║                    CODE WORDS RECOGNIZED BY SCANCODE                  ║
  1146.      ╠═══════════════════════════════════════════════════════════════════════╣
  1147.      ║ Alt, LeftAlt, LftAlt, LtAlt, LAlt                                     ║
  1148.      ║ BackSpace, BackSp, BkSpace, BkSp                                      ║
  1149.      ║ Break, Brk                                    ** SEE SPECIAL NOTES ** ║
  1150.      ║ CapsLock, CapsLk, CapLock, CapLk                                      ║
  1151.      ║ Control, Ctrl, Ctl, LeftControl, LeftCtrl, LeftCtl,  LftControl,      ║
  1152.      ║    LftCtrl, LftCtl, LtControl, LtCtrl, LtCtl, LControl, LCtrl, LCtl   ║
  1153.      ║ Delete, Del                                                           ║
  1154.      ║ Down, Dn                                                              ║
  1155.      ║ End                                                                   ║
  1156.      ║ Enter, Return, Rtn, Ret                                               ║
  1157.      ║ Escape, Esc                                                           ║
  1158.      ║ F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12                     ║
  1159.      ║ Grey+, Gry+, G+,  Grey-, Gry-, G-,  Grey*, Gry*, G*,  Grey/, Gry/, G/ ║
  1160.      ║ Grey5, Gry5, G5                                                       ║
  1161.      ║ GreyDelete, GreyDel, GryDelete, GryDel, GDelete, GDel                 ║
  1162.      ║ GreyDown, GryDown, GDown, GreyDn, GryDn, GDn                          ║
  1163.      ║ GreyEnd, GryEnd, GEnd                                                 ║
  1164.      ║ GreyEnter, GryEnter, GEnter                                           ║
  1165.      ║ GreyHome, GryHome, GHome                                              ║
  1166.      ║ GreyInsert, GreyIns, GryInsert, GryIns, GInsert, GIns                 ║
  1167.      ║ GreyLeft, GryLeft, GLeft                                              ║
  1168.      ║ GreyPageDown, GreyPageDn, GreyPgDown, GreyPgDn, GryPageDown,          ║
  1169.      ║    GryPageDn, GryPgDown, GryPgDn, GPageDown, GPageDn, GPgDown, GPgDn  ║
  1170.      ║ GreyPageUp, GreyPgUp, GryPageUp, GryPgUp, GPageUp, GPgUp              ║
  1171.      ║ GreyReturn, GreyRtn, GreyRet, GryReturn, GryRtn, GryRet,              ║
  1172.      ║    GReturn, GRtn, GRet                                                ║
  1173.      ║ GreyRight, GryRight, GRight, GreyRt, GryRt, GRt                       ║
  1174.      ║ GreyUp, GryUp, GUp                                                    ║
  1175.      ║ Home                                                                  ║
  1176.      ║ Insert, Ins                                                           ║
  1177.      ║ Left, Lft, Lt                                                         ║
  1178.      ║ NumLock, NumLk                                                        ║
  1179.      ║ PageDown, PageDn, PgDown, PgDn                                        ║
  1180.      ║ PageUp, PgUp                                                          ║
  1181.      ║ Pause                                                                 ║
  1182.      ║ PrintScreen, PrintScrn, PrintScn, PrintScr, PrtScreen, PrtScrn,       ║
  1183.      ║    PrtScn, PrtScr                             ** SEE SPECIAL NOTES ** ║
  1184.      ║ Release, Rls                                  ** SEE SPECIAL NOTES ** ║
  1185.      ║ Right, Rt                                                             ║
  1186.      ║ RightAlt, RtAlt, RAlt                                                 ║
  1187.      ║ RightControl, RightCtrl, RightCtl, RtControl, RtCtrl, RtCtl,          ║
  1188.      ║    RControl, RCtrl, RCtl                                              ║
  1189.      ║ RightShift, RightSft, RtShift, RtSft, RShift, RSft                    ║
  1190.      ║ ScrollLock, ScrollLk, ScrlLock, ScrlLk                                ║
  1191.      ║ Shift, Sft, LeftShift, LeftSft, LftShift, LftSft,                     ║
  1192.      ║    LtShift, LtSft, LShift, LSft                                       ║
  1193.      ║ Space                                                                 ║
  1194.      ║ SystemRequest, SystemReq, SystemRq, SysRequest, SysReq, SysRq         ║
  1195.      ║ Tab                                                                   ║
  1196.      ║ Up                                                                    ║
  1197.      ╚═══════════════════════════════════════════════════════════════════════╝
  1198.  
  1199.  
  1200.  
  1201.                       SCANCODE 4.10            Page 20 of 34
  1202.  
  1203.  
  1204.                   DECIMAL KEYBOARD SCAN CODES (STANDARD KEYBOARD)
  1205.      ╔══╤══════╦══╤═══════╦══╤══════╦══╤═══════╦══╤════════╦══╤════════╗
  1206.      ║  │      ║16│ q     ║32│ d    ║48│ b     ║64│ F6     ║80│ Down   ║
  1207.      ║ 1│ Esc  ║17│ w     ║33│ f    ║49│ n     ║65│ F7     ║81│ PgDn   ║
  1208.      ║ 2│ 1    ║18│ e     ║34│ g    ║50│ m     ║66│ F8     ║82│ Ins    ║
  1209.      ║ 3│ 2    ║19│ r     ║35│ h    ║51│ ,     ║67│ F9     ║83│ Del    ║
  1210.      ║ 4│ 3    ║20│ t     ║36│ j    ║52│ .     ║68│ F10    ║84│ SysReq ║
  1211.      ║ 5│ 4    ║21│ y     ║37│ k    ║53│ /     ║69│ NumLk  ║85│        ║
  1212.      ║ 6│ 5    ║22│ u     ║38│ l    ║54│ RSft  ║70│ ScrlLk ║86│        ║
  1213.      ║ 7│ 6    ║23│ i     ║39│ ;    ║55│ Grey* ║71│ Home   ║87│ F11    ║
  1214.      ║ 8│ 7    ║24│ o     ║40│ '    ║56│ Alt   ║72│ Up     ║88│ F12    ║
  1215.      ║ 9│ 8    ║25│ p     ║41│ `    ║57│ Space ║73│ PgUp   ║89│        ║
  1216.      ║10│ 9    ║26│ [     ║42│ LSft ║58│ CapLk ║74│ Grey-  ║90│        ║
  1217.      ║11│ 0    ║27│ ]     ║43│ \    ║59│ F1    ║75│ Left   ║91│        ║
  1218.      ║12│ -    ║28│ Enter ║44│ z    ║60│ F2    ║76│ Grey5  ║92│        ║
  1219.      ║13│ =    ║29│ Ctrl  ║45│ x    ║61│ F3    ║77│ Right  ║93│        ║
  1220.      ║14│ BkSp ║30│ a     ║46│ c    ║62│ F4    ║78│ Grey+  ║94│        ║
  1221.      ║15│ Tab  ║31│ s     ║47│ v    ║63│ F5    ║79│ End    ║95│        ║
  1222.      ╚══╧══════╩══╧═══════╩══╧══════╩══╧═══════╩══╧════════╩══╧════════╝
  1223.  
  1224.  
  1225.                   DECIMAL KEYBOARD SCAN CODES (ENHANCED KEYBOARD)
  1226.      ╔═══════════════╤═══════════╦════════╤═══════════╦════════╤══════════╗
  1227.      ║ 224-28        │ GreyEnter ║ 224-71 │ GreyHome  ║ 224-80 │ GreyDown ║
  1228.      ║ 224-29        │ RightCtrl ║ 224-72 │ GreyUp    ║ 224-81 │ GreyPgDn ║
  1229.      ║ 224-42-224-55 │ PrtScr    ║ 224-73 │ GreyPgUp  ║ 224-82 │ GreyIns  ║
  1230.      ║ 224-53        │ Grey/     ║ 224-75 │ GreyLeft  ║ 224-83 │ GreyDel  ║
  1231.      ║ 224-56        │ RightAlt  ║ 224-77 │ GreyRight ║ 225-29 │ Pause    ║
  1232.      ║ (Ctrl)-224-70 │ Ctrl-Brk  ║ 224-79 │ GreyEnd   ║        │          ║
  1233.      ╚═══════════════╧═══════════╩════════╧═══════════╩════════╧══════════╝
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.                       SCANCODE 4.10            Page 21 of 34
  1262.  
  1263.  
  1264.      HOLDING DOWN MORE THAN ONE KEY AT A TIME
  1265.      ════════════════════════════════════════
  1266.  
  1267.      Most of the time when you type  something on the keyboard, you press and
  1268.      release keys one at a time.  When you use SCANCODE, you normally want it
  1269.      to do the same  thing.  For example,  if you type "SCANCODE Enter  Esc",
  1270.      SCANCODE pushes the  <Enter> key,  then releases the  <Enter> key,  then
  1271.      presses the <Esc> key, and then releases the <Esc> key.  Unless you tell
  1272.      SCANCODE  specifically   to  wait  before  releasing   a  key,  SCANCODE
  1273.      automatically releases a key immediately after it presses it.
  1274.  
  1275.      There are times, however, when you want to have SCANCODE  hold down more
  1276.      than  one key on the  keyboard at a  time (for example, to  do a <Ctrl>-
  1277.      <Alt>-<Del>).   You tell  SCANCODE to  do this  by putting  dashes ("-")
  1278.      between the Scan Codes.  For example, "SCANCODE Ctrl-Alt-Del" pushes the
  1279.      <Ctrl>, <Alt>,  and <Del>  keys all  down at the  same time  (this would
  1280.      normally reboot  your computer).  The  same thing holds true  if you use
  1281.      decimal Scan Codes (rather  than Code Words).  "SCANCODE  Ctrl-56-83" or
  1282.      "SCANCODE 29-56-83" is the same as "SCANCODE Ctrl-Alt-Del".
  1283.  
  1284.      You cannot directly enter single keys, such as "SCANCODE c".  This would
  1285.      confuse SCANCODE.   If you  want to enter a  single character such  as a
  1286.      <c>, you  must enter it  in quotes  ("SCANCODE 'c'").   You also  cannot
  1287.      directly enter keystroke combinations, such as "SCANCODE h-3", where the
  1288.      first key  in the  combination is  a letter,  number, or  other "normal"
  1289.      character.  The first key in a keystroke combination MUST be a Code Word
  1290.      or a decimal Scan Code  (if, for some obscure reason, you wanted to hold
  1291.      down  the <h>  and  the <3>  at the  same time,  you  could either  do a
  1292.      "SCANCODE 35-04" or a "SCANCODE 35-3").
  1293.  
  1294.      You  can,  however,  enter  keystroke combinations  such  as  <Ctrl>-<C>
  1295.      ("SCANCODE Ctrl-C")  or <Alt>-<1>  ("SCANCODE Alt-1"), where  the SECOND
  1296.      key in the combination is  a "normal" character (like  a "C" or a  "1").
  1297.      In  the second example ("SCANCODE Alt-1"), there could be some confusion
  1298.      as to whether  "SCANCODE Alt-1" is telling  SCANCODE to do  an <Alt>-<1>
  1299.      (where the "1" is the <1> key, which has a Scan Code of 2), or an <Alt>-
  1300.      <Esc> (where the "1"  is the Scan Code 1,  which is the <Esc> key).   If
  1301.      you  give  SCANCODE a  single number  after  a dash  ("SCANCODE Alt-1"),
  1302.      SCANCODE assumes it is the key corresponding to the number  key (in this
  1303.      case, the <1> key).  If you want SCANCODE  to do an <Alt>-<Esc>, you can
  1304.      type "SCANCODE  Alt-01"  (or "SCANCODE  Alt-Esc").   A two-digit  number
  1305.      after a dash  (in this case  01) always signifies  to SCANCODE that  the
  1306.      number is a Scan Code, and not one of the number keys on the keyboard.
  1307.  
  1308.      There is one more little thing you need to know when entering a "normal"
  1309.      key as the  second character  in a keystroke  combination (for  example,
  1310.      "SCANCODE  Ctrl-A" or  "SCANCODE Ctrl-a").    "SCANCODE Ctrl-A"  (with a
  1311.      capital "A") and  "SCANCODE Ctrl-a" (with a  small "a") are EXACTLY  the
  1312.      same to SCANCODE.  Telling SCANCODE you want a capital "A" does NOT tell
  1313.      SCANCODE to  push the <Shift> key.  If you want do a <Ctrl>-<Shift>-<a>,
  1314.      you  need to  type "SCANCODE  Ctrl-Shift-A" or  "SCANCODE Ctrl-Shift-a".
  1315.      The same  thing holds true for  the characters above the  number keys on
  1316.      the  keyboard (for  example, "SCANCODE  Ctrl-@" is  exactly the  same to
  1317.      SCANCODE as "SCANCODE Ctrl-2").
  1318.  
  1319.  
  1320.  
  1321.                       SCANCODE 4.10            Page 22 of 34
  1322.  
  1323.  
  1324.      If  you want to do  a repeating keystroke (see  the section above on the
  1325.      DELAY command line Option for a further description), you must enter the
  1326.      DELAY with a  "Dly nn" or a "Delay  nn" - a "D  nn" will not work.   For
  1327.      example, say you want  to hold down  the <Ctrl> key for  1 second.   You
  1328.      could type "SCANCODE Ctrl-Dly 1" or "SCANCODE 29-Delay 1", but
  1329.      "SCANCODE Ctrl-D1" would  not do what  you wanted it  to do.   "SCANCODE
  1330.      Ctrl-D1" would do a <Ctrl>-<D>, <Esc>.
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.                       SCANCODE 4.10            Page 23 of 34
  1382.  
  1383.  
  1384.      WHAT ARE SCAN CODES?
  1385.      ════════════════════
  1386.  
  1387.      When  you  press  (or release)  a  key  on  the  keyboard, the  keyboard
  1388.      generates  what is  known  as a  hardware  interrupt.   This  tells  the
  1389.      computer that the  keyboard has a  keystroke waiting for  it.  When  the
  1390.      computer is  ready for the  keystroke, it asks  the keyboard to  tell it
  1391.      which key  was pressed or released.  The keyboard responds by giving the
  1392.      computer  a Scan Code.  Each key on  the keyboard has a unique Scan Code
  1393.      (or set of Scan Codes) when it is pressed, and a different Scan Code (or
  1394.      set of Scan Codes) when it is released.
  1395.  
  1396.      The Scan Code is then processed by the BIOS (Basic Input Output System).
  1397.      Depending on  which key was pressed  or released, and which  key(s) were
  1398.      pressed  or  released  before that,  the  BIOS  either  stuffs an  ASCII
  1399.      character into the keyboard buffer, remembers that the key  was a "Shift
  1400.      Key"  (Shift, Alt,  Ctrl, CapLk,  NumLk, etc.),  or performs  some other
  1401.      function   (such  as  printing  the  screen  in  the  case  of  <Shift>-
  1402.      <PrintScreen>).
  1403.  
  1404.      There  is not  a  1-to-1 correspondence  between  Scan Codes  and  ASCII
  1405.      characters.   For example,  the following  sequence of  keystrokes would
  1406.      normally generate the ASCII character "A":
  1407.  
  1408.        Push<Shift>, Push<a>, Release<Shift>, Release<a>.
  1409.  
  1410.      The following sequence of keystrokes would also generate an "A":
  1411.  
  1412.        Push<CapsLock>,      Release<CapsLock>,      Push<a>,      Release<a>,
  1413.        Push<CapsLock>, Release<CapsLock>.
  1414.  
  1415.      The Tables  above list the Scan  Codes that a keyboard  generates when a
  1416.      key is Pushed on the keyboard.  A different  Scan Code is generated when
  1417.      the key is  Released (usually, it is the Push Scan  Code plus 128).  For
  1418.      example, when you  Push the <Esc> key,  the keyboard generates  the Scan
  1419.      Code 1.  If you keep holding  down the <Esc> key, the keyboard will keep
  1420.      generating Scan Codes of 1.  When you finally release the <Esc> key, the
  1421.      keyboard generates  a Scan Code of 129.  SCANCODE knows how to calculate
  1422.      all of the Return Scan Codes.
  1423.  
  1424.      You  tell SCANCODE  which  Push Scan  Codes to  use and  when to  do the
  1425.      Release Scan Codes (actually, to be fair, you tell SCANCODE  when to NOT
  1426.      do the Release Scan Codes - see  the section above on "HOLDING DOWN MORE
  1427.      THAN  ONE KEY AT  A TIME").   This sounds complicated,  so let's give an
  1428.      example.    Let's use  SCANCODE  to enter  an  ASCII "A"  using  the two
  1429.      different keystroke sequences shown above.   We'll use "P" for Push  and
  1430.      "R" for Release.
  1431.  
  1432.        SCANCODE Shift  -  a
  1433.          REM    P<Shift>  P<a>  R<Shift, a>
  1434.  
  1435.        SCANCODE CapsLock                "a"       58
  1436.          REM    P<CapsLock> R<CapsLock> P<a> R<a> P<CapsLock> R<CapsLock>
  1437.  
  1438.  
  1439.  
  1440.  
  1441.                       SCANCODE 4.10            Page 24 of 34
  1442.  
  1443.  
  1444.      As  another example,  let's  hold down  the  shift key  for  ten seconds
  1445.      (making everything you type for the next ten seconds be capitalized):
  1446.  
  1447.        SCANCODE LeftShift -  Delay 10
  1448.          REM    P<LeftShift> <Hold it down for 10 seconds, R<LeftShift>>
  1449.  
  1450.      As a last example, let's wait 1 minute and then reboot the computer with
  1451.      <Ctrl>-<Alt>-<Del>  (this could  be a  nasty line  to put  in somebody's
  1452.      AUTOEXEC.BAT file):
  1453.  
  1454.        SCANCODE Delay 60           Ctrl -  Alt -  Del
  1455.          REM    <Delay 60 seconds> P<Ctrl> P<Alt> P<Del>  R<Ctrl, Alt, Del>
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.                       SCANCODE 4.10            Page 25 of 34
  1502.  
  1503.  
  1504.      HOW SCANCODE WORKS
  1505.      ══════════════════
  1506.  
  1507.      As  discussed above,  SCANCODE is  a TSR  (Terminate and  Stay Resident)
  1508.      program.   SCANCODE temporarily  installs itself  into memory,  does its
  1509.      DELAY,  WAIT,  and keystroke  things,  and then  UNINSTALLs  itself from
  1510.      memory (if  it can).   While  it is installed  in memory,  SCANCODE uses
  1511.      approximately 2800 bytes of  RAM.  Again, SCANCODE only uses this memory
  1512.      as long as  it needs it to  do its stuff, and  then it gives the  memory
  1513.      back to DOS so that other programs can use it.
  1514.  
  1515.      SCANCODE  ties  itself to  the timer  interrupt  of the  computer, which
  1516.      occurs  approximately  18  times per  second.    Every  time this  timer
  1517.      interrupt occurs, SCANCODE  does something.  It either does  a series of
  1518.      keystroke "presses",  a series of keystroke "releases",  or does nothing
  1519.      (if it is in the middle of a Delay or a Wait).  For example:
  1520.  
  1521.        SCANCODE "A"                     "s"       "k"
  1522.         REM    P<Shift, a> R<Shift, a> P<s> R<s> P<k> R<k>
  1523.  
  1524.      would do a <Shift>-<a>, wait 1/18 of a  second, release the <Shift>-<a>,
  1525.      wait 1/18  of a second, do  an <s>, wait  1/18 of a second,  release the
  1526.      <s>, wait 1/18 of a second, do a <k>, wait 1/18 of a second, release the
  1527.      <k>, wait 1/18 of a second, then remove itself from memory.
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.                       SCANCODE 4.10            Page 26 of 34
  1562.  
  1563.  
  1564.      SPECIAL NOTES
  1565.      ═════════════
  1566.  
  1567.      SCANCODE tries  to "fake" programs  out by simulating  keyboard hardware
  1568.      interrupts.   SCANCODE  gives the  computer  keyboard Scan  Codes  (with
  1569.      software) that  the computer  thinks  came from  the keyboard  hardware.
  1570.      This is something that the computer isn't supposed to be able to do, and
  1571.      unfortunately,  it doesn't always work correctly.   There are only a few
  1572.      programs that don't  work with SCANCODE.   You will just have  to try it
  1573.      and see.
  1574.  
  1575.  
  1576.      SCANCODE will let you enter as many Scan Codes as you can enter from the
  1577.      DOS command line (the DOS command line is 128 characters long).  If that
  1578.      isn't enough Scan Codes for whatever you're trying to do,  you will have
  1579.      to use SCANCODE  more than once.  If you use  it more than once, and you
  1580.      want to make  sure the first one  is done before the  second one starts,
  1581.      you  will need  to "communicate"  between the  two  SCANCODEs.   You can
  1582.      either  put a Delay, WaitForText, or WaitForKey  at the beginning of the
  1583.      second SCANCODE to make sure the first one is done before it starts (see
  1584.      the examples below).
  1585.  
  1586.  
  1587.      SCANCODE doesn't use  a lot of memory  (about 2800 bytes).  It  does use
  1588.      enough that you might have some concern, however, especially if you want
  1589.      to load several SCANCODEs into memory at the same time.  You can use the
  1590.      LOADHI (or LH)  DOS commands to  load SCANCODE into  High Memory if  you
  1591.      want  to save  Conventional Memory  for your  other programs.   SCANCODE
  1592.      works fine in High Memory.
  1593.  
  1594.  
  1595.      If you  read the section above,  "HOW SCANCODE WORKS", it  says that the
  1596.      timer interrupt occurs  approximately 18  times per second.   The  exact
  1597.      number of times  it occurs is 18.21 times per  second.  When calculating
  1598.      how  long wait  during  a  Delay,  SCANCODE  multiplies  the  number  of
  1599.      "seconds" you  tell it to Delay by  18 (not 18.21), and  Delays for that
  1600.      many timer interrupts to happen.  There is enough discrepancy between 18
  1601.      and 18.21 that SCANCODEs timing  is not exact.  If you  tell SCANCODE to
  1602.      Delay  for 60 "seconds", it will actually Delay for (approximately) 59.3
  1603.      seconds.  If  you tell SCANCODE to Delay the  maximum of 3600 "seconds",
  1604.      it  will actually Delay for  59 minutes and  19 seconds (approximately).
  1605.      The bottom line is that the Delay times are approximate, no exact.  They
  1606.      are  close enough, though,  that under normal circumstances  it is not a
  1607.      concern.
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.                       SCANCODE 4.10            Page 27 of 34
  1622.  
  1623.  
  1624.      Let's assume you had the following SCANCODEs in memory:
  1625.  
  1626.        SCANCODE Delay 10, F1
  1627.        SCANCODE Delay 01, Enter
  1628.        SCANCODE Delay 5, Uninstall, "Done"
  1629.  
  1630.      The first SCANCODE line will try to Delay for 10 seconds and then "type"
  1631.      an <F1>.  The  second line will try to "type" an  <Enter> after only one
  1632.      second.   The last  line will  Uninstall ("turn  off" or  "disable") the
  1633.      other  two lines  after five  seconds, and  then type  "Done".   The end
  1634.      result of this series would be that the second line would "type" <Enter>
  1635.      after  one second;  then the  third line would  Uninstall the  first two
  1636.      lines four seconds  later;  then the third line would  type "Done".  The
  1637.      first line would never get a chance to "type" <F1>.
  1638.  
  1639.  
  1640.      If you  have more than  one SCANCODE in memory,  it is also  possible to
  1641.      have more than one  of them WaitForText-ing (or WaitForKey-ing)  for the
  1642.      SAME  "Text" (or  <key>).   It is  also possible  to have more  than one
  1643.      SCANCODE trying to "type" something at the same time.   When this is the
  1644.      case, the LAST  SCANCODE in memory is the one that goes first.  This can
  1645.      get really complicated, so see if you  can follow me.  Let's say you had
  1646.      the following SCANCODES in memory:
  1647.  
  1648.        SCANCODE WaitText 1,1 "File", "A", WaitKey "B", "22"
  1649.        SCANCODE WaitKey  F2, F1
  1650.        SCANCODE WaitKey  F1, Uninstall, "B", WaitKey "2", "25"
  1651.        SCANCODE WaitText 1,1 "F", WaitKey "A", F2, WaitKey "B", U, "21"
  1652.  
  1653.      If the string "File" appeared on the screen at row 1,  column 1, this is
  1654.      what would  happen.  The last SCANCODE would see  the "F" in "File", and
  1655.      then start waiting for an <a> key.  The third SCANCODE is waiting for an
  1656.      <F1>.  The second SCANCODE is  waiting for an <F2>.  The  first SCANCODE
  1657.      sees the word "File", "types" a <Shift>-<a>, and then starts waiting for
  1658.      a <b>.  The last SCANCODE then  goes again, sees the <a> that was  typed
  1659.      by the  first SCANCODE, "converts" it to  an <F2>, and then  waits for a
  1660.      <b>.   The third  SCANCODE is  still waiting  for an <F1>.   The  second
  1661.      SCANCODE sees the <F2> "typed" by the last SCANCODE, "converts" it to an
  1662.      <F1>, and then removes itself from memory.  The first  SCANCODE is still
  1663.      waiting  for a <b>.   We then go  to the last SCANCODE  again.  The last
  1664.      SCANCODE is still waiting for a <b>.   The third SCANCODE sees the  <F1>
  1665.      "typed" by  the second  SCANCODE,  Uninstalls (disables)  the first  two
  1666.      SCANCODES  from memory, and  then "types" a <Shift>-<b>.   The first two
  1667.      SCANCODEs have been disabled, so we're back at the last  SCANCODE again,
  1668.      which  is waiting  for a  <b>.   It  sees  the <b>  typed  by the  third
  1669.      SCANCODE, Uninstalls the third SCANCODE from  memory, types a <2> and  a
  1670.      <1>, and then Uninstalls itself from memory.
  1671.  
  1672.      Whew!   If  you  managed to  follow  all  that, congratulations.    This
  1673.      particular  example didn't really do anything useful.  Hopefully, it did
  1674.      show  you how different SCANCODEs can "communicate" with each other with
  1675.      Uninstall's  and WaitForKey's, and to maybe start you thinking about all
  1676.      the wonderful things you can do with your batch files.
  1677.  
  1678.  
  1679.  
  1680.  
  1681.                       SCANCODE 4.10            Page 28 of 34
  1682.  
  1683.  
  1684.      There  are some  special considerations  you need to  keep in  mind when
  1685.      using multiple WAITFORKEY Options at the  same time along with the  LOOP
  1686.      or REPEAT Options.  Say you had a program where you wanted to switch the
  1687.      <Control> and <CapsLock> keys with each  other.  You might be tempted to
  1688.      try and set up a batch file which included the following lines:
  1689.  
  1690.          SCANCODE WaitForKey Control, CapsLock, Repeat
  1691.            REM Turn <Control> into <CapsLock>
  1692.          SCANCODE WaitForKey CapsLock, Control, Repeat
  1693.            REM Turn <CapsLock> into <Control>
  1694.  
  1695.      Unfortunately,  this would not switch  the <Control> and <CapsLock> keys
  1696.      for  you.   Say, for  instance, you hit  the <Control>  key.   The first
  1697.      SCANCODE would "intercept"  it, and "type" a <CapsLock>.   This would in
  1698.      turn be "intercepted" by the second SCANCODE,  which would then "type" a
  1699.      <Control>.    You  might  then  think  that  the  first  SCANCODE  would
  1700.      "intercept" this <Control>  and turn it into a  <CapsLock>.  Normally it
  1701.      would;  however,  because  of some  internal  timing  issues, the  first
  1702.      SCANCODE has  not yet had time  to "reset" itself and  start looking for
  1703.      another <Control> key yet.  The end result is that the <Control> key you
  1704.      typed comes back  to you unchanged  - it just  comes back with  a slight
  1705.      delay.
  1706.  
  1707.      You can use multiple WAITFORKEYs with LOOPs or REPEATs in  memory at the
  1708.      same time, but in general what the <keys>  are being changed to and from
  1709.      must  be  completely  independent  of each  other  among  the  different
  1710.      SCANCODEs.   The fact that  SCANCODEs can interact  with each  other via
  1711.      "typed"  keys  in  one  way  greatly  increases  their  flexibility  and
  1712.      usefulness,  yet in another way limits their flexibility and usefulness.
  1713.      I believe the ability for SCANCODEs to "talk" to each  other via "typed"
  1714.      keys is  very useful,  even though  it limits their  ability for  you to
  1715.      "exchange" <keys>.
  1716.  
  1717.  
  1718.      If you use the WAITFORKEY  Option very much, you will notice  that there
  1719.      is  a slight delay between when you hit  a key and when SCANCODE "types"
  1720.      its  key in response.   There is not  enough delay to  cause problems in
  1721.      most  programs.   However,  if you're  using  SCANCODE  with a  game  or
  1722.      something that requires  quick responses from the keyboard, SCANCODE may
  1723.      have enough delay to cause you some grief.  The delay is inherent in the
  1724.      way SCANCODE works and,  unfortunately, can't be changed easily.   There
  1725.      is a slightly more detailed discussion of this above in the section "HOW
  1726.      SCANCODE WORKS". 
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.                       SCANCODE 4.10            Page 29 of 34
  1742.  
  1743.  
  1744.      SCANCODE  has no problem at all dealing with environment variables.  For
  1745.      example, say you had the following lines in a batch file:
  1746.  
  1747.          SET DLY=10
  1748.          SET TEXT=I found it!
  1749.          IF EXIST TEST.FIL GOTO DoIt
  1750.          SET DLY=5
  1751.          SET TEXT=TEST.FIL does not exist.
  1752.        :DoIt
  1753.          SCANCODE Delay %DLY%, "%TEXT%"
  1754.          SET DLY=
  1755.          SET TEXT=
  1756.  
  1757.      If a  file called TEST.FIL exists, this batch file will Delay 10 seconds
  1758.      and then type  "I found it!".   If the file isn't there,  the batch file
  1759.      will Delay for  just 5 seconds and then type  "TEST.FIL does not exist".
  1760.      If SET and IF EXIST and any of the other stuff here is Greek to you, you
  1761.      need to  invest some time in a good DOS  book that discusses batch files
  1762.      and environment variables;  it will be well worth your time.
  1763.  
  1764.  
  1765.      See the  special notes  above in "HOLDING  DOWN MORE THAN  ONE KEY  AT A
  1766.      TIME" on  the problems you  may encounter  and why SCANCODE  may not  be
  1767.      entering the keys you think it should be entering.
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.                       SCANCODE 4.10            Page 30 of 34
  1802.  
  1803.  
  1804.      SCANCODE AND MICROSOFT WINDOWS
  1805.      ══════════════════════════════
  1806.  
  1807.      Since Microsoft Windows is so rampant these days, I feel it is necessary
  1808.      to talk  about how SCANCODE works with Microsoft Windows.  First of all,
  1809.      SCANCODE is a  DOS program.   It  does not  work at  all if  you are  in
  1810.      Windows and using a Windows program.
  1811.  
  1812.      If  you are just using Windows as  a task-switcher, however, and you are
  1813.      just  shelling out of Windows to run a  DOS program, SCANCODE may or may
  1814.      not work depending  on which version of  Windows you are using.   I have
  1815.      only been able to test SCANCODE with Windows 3.1 and Windows 95.  I have
  1816.      no idea  whether or not  SCANCODE will work  with any other  versions of
  1817.      Windows (1.x,  2.x, 3.0, 3.11,  or any version of  NT).  I  also have no
  1818.      idea whether or not  SCANCODE works with other task-switching  or multi-
  1819.      tasking  programs, such  as DesqView  or the various  implementations of
  1820.      Unix.  If someone  out there is willing to  test this for me and  let me
  1821.      know, I will update the future documentation to reflect this.
  1822.  
  1823.      If you are just shelled  out of Windows and  are actually running a  DOS
  1824.      program,  the following  table tells  you whether  or not  SCANCODE will
  1825.      work:
  1826.  
  1827.        Windows 3.1 in Standard Mode:  SCANCODE works just fine
  1828.        Windows 3.1 in Enhanced Mode:  SCANCODE does not work at all
  1829.        Windows 95:                    SCANCODE works just fine
  1830.  
  1831.      I  just  recently  started using  Window  95,  and,  quite frankly,  was
  1832.      surprised  that SCANCODE worked based on my bad experiences with Windows
  1833.      3.1.  But it  does - and I'm not complaining.  There  are still a lot of
  1834.      DOS programs out  there that people use, even if  Microsoft doesn't want
  1835.      to  admit it.   Hopefully SCANCODE and other  similar programs will make
  1836.      life easier for you when you are using these "old" DOS programs.
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.                       SCANCODE 4.10            Page 31 of 34
  1862.  
  1863.  
  1864.      A WORD FROM THE SPONSOR
  1865.      ═══════════════════════
  1866.  
  1867.      SCANCODE is a free  program.  If  you like it and  use it, do  something
  1868.      nice for someone  else in return.  I  will accept niceties to  myself in
  1869.      the form of $.
  1870.  
  1871.      You  can  freely copy  and distribute  SCANCODE.COM,  as long  as  it is
  1872.      distributed  along  with this  SCANCODE.DOC, and  neither file  has been
  1873.      modified in any way.  You cannot charge anyone in any  way for SCANCODE,
  1874.      except  for a small  charge to cover  your costs for  disks and shipping
  1875.      (you  cannot charge  for  "handling").   You  do need  my  permission to
  1876.      distribute SCANCODE as a "companion" to some other program.
  1877.  
  1878.  
  1879.      OTHER PROGRAMS
  1880.      ══════════════
  1881.  
  1882.      If you  like SCANCODE, I have  written some other programs  you may find
  1883.      useful.
  1884.  
  1885.        CLOCK
  1886.           Shows a clock  on your screen  all the time.   Also has two  alarms
  1887.           that beep at you when it's time for an appointment.
  1888.  
  1889.        JOYKEYS
  1890.           Lets you use your joystick(s) with ANY program.
  1891.  
  1892.        MOUSKEYS
  1893.           Lets you use your mouse with ANY program.
  1894.  
  1895.        PRTSCR
  1896.           Sends all of your PrintScreens to  a file instead of a printer.   A
  1897.           good  way to transfer data between two programs, even if they won't
  1898.           normally "talk" to each other.
  1899.  
  1900.        PRTSCRFF
  1901.           Modifies  your PrintScreen so that each new PrintScreen gets put on
  1902.           a  new  sheet  of paper  (especially  useful if  you  have  a Laser
  1903.           printer).
  1904.  
  1905.        SERIAL
  1906.           Shows the status  of your serial (COM) ports on  screen.  Shows the
  1907.           bit  rate,  parity, status  of  the leads  (DTR,  DSR,  etc.).   An
  1908.           excellent way to troubleshoot modem problems.
  1909.  
  1910.        SLOWDOWN
  1911.           Slows  down  a fast  computer so  you can  run older  programs that
  1912.           require a PC/XT or PC/AT.
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.                       SCANCODE 4.10            Page 32 of 34
  1922.  
  1923.  
  1924.      WARRANTY
  1925.      ════════
  1926.  
  1927.      There is no warranty of any kind,  either expressed or implied, supplied
  1928.      with SCANCODE.  As with any software, it may  or may not work with other
  1929.      software that you  may have.  I have done my  best to make sure SCANCODE
  1930.      won't screw anything up, but, again, there is no guarantee.
  1931.  
  1932.      If you find any  "bugs" in this program, or see  something that you wish
  1933.      were different,  please let me know.   I can only improve  SCANCODE if I
  1934.      know what you think needs to improve.
  1935.  
  1936.      HAVE FUN!
  1937.  
  1938.      Bret Johnson
  1939.      6775 South Logan Street
  1940.      Littleton, CO  80122-1249
  1941.      (303) 795-5084
  1942.  
  1943.      bretjohn@aol.com
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.                       SCANCODE 4.10            Page 33 of 34
  1982.  
  1983.  
  1984.      REVISION HISTORY
  1985.      ════════════════
  1986.  
  1987.      04/06/93  v1.00
  1988.      04/26/94  v2.00
  1989.        * Changed from executable file to TSR.
  1990.        * Added DELAY (D nn) Option.
  1991.        * Added WAIT (W row col "Wait_Text") Option.
  1992.        * Added QUIET (Q) Option.
  1993.        * Added UNINSTALL (U) Option.
  1994.        * Added environment variable support.
  1995.      05/04/94  v2.01
  1996.        * Modified the  way SCANCODE "fakes"  interrupts, making it  work with
  1997.          more programs.
  1998.      09/08/94  v2.02
  1999.        * Once again modified the  way SCANCODE "fakes" interrupts, making  it
  2000.          work with more programs.
  2001.      12/15/94  v3.00
  2002.        * Completely modified  the SCANCODE user  interface, adding in  all of
  2003.          the Code Words and  dashes and effectively eliminating the  need for
  2004.          "Release" codes.
  2005.      12/30/95  v3.01
  2006.        * Modified the way the program accesses the  computer timer, hopefully
  2007.          making it more compatible with other programs.
  2008.      02/04/96  v4.00
  2009.        * Added KEY (K <key>) Option.
  2010.        * Changed maximum Delay  time from  240 seconds (~4  minutes) to  3600
  2011.          seconds (~1 hour).
  2012.        * Improved error  checking for command line Options.  Now it is harder
  2013.          to enter "illegal" Options.
  2014.        * Modified code  so that if more  than one SCANCODE is  in memory, the
  2015.          later  SCANCODEs reuse  some of  the code  from the  first SCANCODE.
  2016.          Later  SCANCODEs use  approximately 300 bytes  less memory  than the
  2017.          first SCANCODE.
  2018.        * Modified WaitForText Option  so that row and column numbers can be 0
  2019.          (allowing  for text to appear anywhere on  the screen, not just at a
  2020.          specific row and column).
  2021.        * Better recognizes extended text screen modes.  Previously there were
  2022.          special extended video  text modes  (such as certain  ones with  132
  2023.          columns)   that  SCANCODE  mistook   for  extended  graphics  modes.
  2024.          SCANCODE is now able to recognize these as being text modes.
  2025.      09/22/96  v4.10
  2026.        * Added the LOOP and REPEAT Options.
  2027.        * Did a little bit of "housecleaning" on the code and made it slightly
  2028.          smaller and faster than before.
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.                       SCANCODE 4.10            Page 34 of 34
  2042.